package ess

import (
	"fmt"
	"github.com/elastic/go-elasticsearch"
)

var (
	es  *elasticsearch.Client
	err error
)

func InitEs() {
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://123.60.31.223:5601",
		},
	}
	es, err = elasticsearch.NewClient(cfg)
	if err != nil {
		fmt.Println("es 连接失败", err)
		return
	}
	fmt.Println("es 连接成功")
}
